#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<cstring>
#include<algorithm>

using namespace std;

const int N = 25010, M = 110;

int f[N];
int a[M];
int n;

int main()
{
    int t;
    scanf("%d", &t);

    while (t--)
    {
        scanf("%d", &n);
        for (int i = 0; i < n; i++)    scanf("%d", &a[i]);

        sort(a, a + n);
        int m = a[n - 1];
        memset(f, 0, sizeof f);
        f[0] = 1;

        int res = 0;
        for (int i = 0; i < n; i++)
        {
            if (!f[a[i]]) res++;
            for (int j = a[i]; j <= m; j++)
                f[j] += f[j - a[i]];
        }
        cout << res << endl;
    }
    return 0;
}